<template>
	<body-wrap isFlex>
		<template #header>
			<view class="pbTopBox">
				<view class="lfbox"><text class="name">张通榆</text> 预约表</view>
				<view class="rtbox">
					<view class="icon"><cm-image src="static/images/sjt.png"/></view>
					<view class="time" @click="openDate">{{curDate}} 星期四</view>
					<view class="icon icon2"><cm-image src="static/images/sjt.png"/></view>
				</view>
			</view>
		</template>
		<view class="pbList">
			<view class="pbListItem" v-for="dt in 15" :key="dt">
				<view class="maincon" :class="{'selected':dt==2}">
					<text class="time">11:00 - 12:00</text>
					<text class="renshu">（1/4）</text>
					<text class="price">
						<text class="fh">￥</text> 129.00
					</text>
				</view>
			</view>
		</view>
		<template #footer>
			<view class="footer-btn-box">
				<navigator class="myBtn" url="/pages/preBook/add">立即预约</navigator>
			</view>
		</template>
		<uni-datetime-picker ref="dtpRef" class="mydpdate" type="date" :clear-icon="false" v-model="curDate" @change="setDate">
			<template #default>
				<view></view>
			</template>
		</uni-datetime-picker>
	</body-wrap>
</template>

<script>
	import {defineComponent,reactive,toRefs,onMounted,getCurrentInstance,computed} from 'vue'
	import {onLoad,onShow} from '@dcloudio/uni-app'
	import { useStore } from 'vuex'
	import bodyWrap from "@/components/bodyWrap/index.vue"
	import cmImage from "@/components/cmImage/index.vue"
	export default defineComponent({
		components:{
			bodyWrap,
			cmImage
		},
		props:{
		
		},
		setup(props,context) {
			const store = useStore()
			const {proxy} = getCurrentInstance()
			
			const state = reactive({
				imgUrlPrefix:getApp().globalData.imgUrlPrefix,
				curDate:'2023-12-28'
			})
			
			onMounted(()=>{
				
			})
			
			const openDate = ()=>{
				proxy.$refs.dtpRef.show()
			}
			
			const setDate = ()=>{
				console.log("curDate:",state.curDate)
			}
			
			return {
				...toRefs(state),
				setDate,
				openDate
			}
		}
	})
</script>

<style lang="scss" scoped>
	.pbTopBox{
		display: flex;
		height: 80rpx;
		align-items: center;
		padding: 0 20rpx;
		background-color: #f7f7f7;
		box-shadow: 5rpx 0 10rpx #999;
		.lfbox{
			font-size: 28rpx;
			flex: 1;
			flex-shrink: 0;
			.name{
				color: #e3af2f;
			}
		}
		.rtbox{
			flex-shrink: 0;
			display: flex;
			align-items: center;
		}
		.icon{
			width: 50rpx;
			height: 50rpx;
			overflow: hidden;
			opacity: 0.5;
			transform: rotate(-90deg);
			-webkit-transform: rotate(-90deg); 
			&.icon2{
				transform: rotate(90deg);
				-webkit-transform: rotate(90deg);
			}
		}
	}
	.pbList{
		box-sizing: border-box;
		width: 100%;
		padding:0 10rpx;
		&::after{
			content: '';
			display: table;
			clear: both;
			line-height: 0;
			height: 0;
		}
		.pbListItem{
			box-sizing: border-box;
			float: left;
			width: 33.333%;
			padding: 0 10rpx;
			padding-top: 20rpx;
			.maincon{
				box-sizing: border-box;
				width: 100%;
				border: 1px solid #eee;
				background: #fff;
				border-radius: 10rpx;
				font-size: 28rpx;
				text-align: center;
				line-height: 40rpx;
				padding: 10rpx 0;
				.time,.renshu,.price{
					display: block;
				}
				.price{
					font-size: 30rpx;
					font-weight: 700;
					padding: 7rpx 0 0 0;
					color: #d50000;
					.fh{
						font-size: 22rpx;
						color: #999;
						font-weight: normal;
					}
				}
				&.selected{
					background: #e3af2f;
					border: 1px solid #e3af2f;
					color: #fff;
				}
			}
		}
	}
	
	
	
	
	
	
</style>
